<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // var arr=[10,20,30,40];
        // console.log(arr);//非关联数组---索引数组

        // var arr2=[];
        // arr2[0]=100;
        // arr2["hello"]="hello";
        // arr2["a"]="aaa";
        // console.log(arr2);//关联数组

        // for(var i=0;i<arr.length;i++){
        //     console.log(arr[i]);
        // }

        // for(var i in arr2){
        //    // console.log(i);
        //     console.log(arr2[i]);
        // }

        var obj={
         color:"red",
         backgroundColor:"blue"
       }
       for(var key in obj){
           console.log(key);
          //console.log(obj[key]);//value
        }

    </script>
</body>
</html>